package com.example.listener;

import com.example.message.User;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQReplyListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "test-topic",selectorExpression = "object",consumerGroup = "user")
public class UserMessageListener implements RocketMQReplyListener<User,String> {
    @Override
    public String onMessage(User o) {
        System.out.println(o);
        return "consume success";
    }
}
